Javascript program to swap two numbers without using temporary variable
To swap two numbers without using a temporary variable, we have multiple approaches. In this article, we are going to learn how to swap two numbers without using a temporary variable....
read more
JavaScript program to check whether a given number is power of 2
Given a positive integer n, write a function to find if it is a power of 2 or not...
read more
Javascript Program for Number of unique triplets whose XOR is zero
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
read more
Php Program to Check if two numbers are bit rotations of each other or not
Given two positive integers x and y, check if one integer is obtained by rotating bits of other....
read more
Javascript Program to Check if two numbers are bit rotations of each other or not
Given two positive integers x and y (0 < x, y < 2^32), check if one integer is obtained by rotating bits of the other....
read more
Count set bits in an integer
Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :...
read more
Maximize count of indices with same element by pairing rows from given Matrices
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any row in the array b[][] such that the total score can be maximized and the score for each pair is calculated as the total indexes at which values of both rows are identical....
read more
Classification of Algorithms with Examples
There are many ways of classifying algorithms and a few of them are shown below:...
read more
Java Program for Number of unique triplets whose XOR is zero
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
read more
Python3 Program for Number of unique triplets whose XOR is zero
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
read more
C program to count zeros and ones in binary representation of a number
Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N....
read more
BCD addition of given Decimal numbers
Given two numbers A and B, the task is to perform BCD Addition of the given numbers....
read more